package com.vcredit.bird.util;

import org.apache.commons.lang.StringUtils;


public class CommonUtil {

	public static boolean certNoCompare(String newIdNo, String oldIdNo) {
		String newNo = null;
		String oldNo = null;
		if (newIdNo.length() >= 4) {
			newNo = newIdNo.substring(newIdNo.length() - 4);
		}
		if (oldIdNo.length() >= 4) {
			oldNo = oldIdNo.substring(oldIdNo.length() - 4);
		}
		if (newNo.equalsIgnoreCase(oldNo))
			return true;
		return false;
	}
	
	public static boolean validJsonString(String resultJson) {
	    boolean valid = false;
	    if (StringUtils.isEmpty(resultJson)) {
            return valid;
        }
	    
	    if (resultJson.trim().startsWith("{") && resultJson.trim().endsWith("}")) {
	        valid = true;
        }
        return valid;
	}
}
